<template>
  <Nav :showBlack="true" title="长江颂·茶道套盒"></Nav>
  <div class="page">
    <div class="main-info">
      <div class="imgBox" style="background: pink"></div>
      <div class="nameBox">
        <div class="name">长江颂·茶道套盒</div>
        <div class="control">
          <div class="viewBox">
            <img src="../assets/look.png" alt="">
            <span>18</span>
          </div>
          <div class="likeBox">
            <img src="../assets/like.png" alt="">
            <span>3</span>
          </div>
        </div>
      </div>
      <div class="tags">
        <div class="tag">书型礼盒</div>
        <div class="tag">茶经</div>
        <div class="tag">利川红茶</div>
        <div class="tag">泡茶宝</div>
      </div>
      <div class="info">
        在长江之滨，荆楚之地，长江出版集团屹立二十载，传承文化，启迪智慧。套盒整体以书卷为形，典雅大方，既是包装，亦是书柜中的精致摆件。盒面融入湖北元素，以长江天际线为饰，展现长江之畔的荆楚风情。内里产品使用宣纸印刷茶经展现着出版元素和的内涵，搭配国茶大师亲手手工炒制的利川红茶和泡茶保温杯，不仅是对传统文化的尊重与传承，更是对地域特色与文化精髓的展示与推广。
      </div>
      <div class="controlBox">
         <div class="cont border">
           <img src="../assets/share.png" alt="">
           分享藏品
         </div>
         <div class="cont">
           <img src="../assets/like.png" alt="">
           点赞藏品
         </div>
      </div>
    </div>
    <div class="itemSwiper">
       <div class="s-title">
         <div>本系列藏品</div>
         <div>3件藏品</div>
       </div>
      <div class="swiperBox">
        <div class="leftBr">
          <img src="../assets/left-arrow.png" alt="" @click="pre">
        </div>
        <div class="inner">
          <van-swipe class="my-swipe" ref="swiperTop"  @change="onChange" indicator-color="white">
            <van-swipe-item>0</van-swipe-item>
            <van-swipe-item>1</van-swipe-item>
            <van-swipe-item>2</van-swipe-item>
            <van-swipe-item>3</van-swipe-item>
            <van-swipe-item>4</van-swipe-item>
            <van-swipe-item>5</van-swipe-item>
          </van-swipe>
        </div>
        <div class="rightBr">
          <img src="../assets/right-arrow.png" alt="" @click="next">
        </div>
      </div>
      <div class="items-info">
         <div class="info-title">
           <span class="name">茶经</span>
           <span>
             <img src="../assets/like.png" alt="">
             12
           </span>
         </div>
        <div class="f-title">
          宣纸载茶经，手礼传古韵。
        </div>
        <div class="btns">
          <div class="btn" @click="goParic">
            详情鉴赏
          </div>
        </div>
      </div>

    </div>
    <van-swipe  ref="swiperItem" type="card" :height="lang" :width="lang" :loop="false" :show-indicators="false">
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 0}" style="background: pink"  @click="goThis(0)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 1}" style="background: pink" @click="goThis(1)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 2}" style="background: pink" @click="goThis(2)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 3}" style="background: pink"  @click="goThis(3)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 4}" style="background: pink" @click="goThis(4)"></div>
      </van-swipe-item>
      <van-swipe-item default="1">
        <div class="imgBoxInner" :class="{big:swiperIndex == 5}" style="background: pink" @click="goThis(5)"></div>
      </van-swipe-item>
    </van-swipe>
    <div class="courseBlock">
        <div class="head">
          数字课程
        </div>
        <div class="items">
          <div class="item">
            <div class="imgbox"></div>
            <div class="infoBox">
              <div class="info-title">宣纸载茶经，手礼传古韵</div>
              <div class="info-minTitle">宣纸茶经作为文创伴手礼，其文化寓意体现在对传统文化的尊重与传承、艺术与生活的和谐统一</div>
            </div>
          </div>
          <div class="item">
            <div class="imgbox"></div>
            <div class="infoBox">
              <div class="info-title">宣纸载茶经，手礼传古韵</div>
              <div class="info-minTitle">宣纸茶经作为文创伴手礼，其文化寓意体现在对传统文化的尊重与传承、艺术与生活的和谐统一</div>
            </div>
          </div>
        </div>
    </div>
</div>
</template>
<script setup>
import { useRouter } from 'vue-router'
import { ref, onMounted } from 'vue';
import Nav from '@/components/nav.vue'
const swiperTop = ref(null)
const swiperItem = ref(null)
const router = useRouter();
const swiperIndex = ref(0);
const lang =  window.innerWidth / 1080 * 280
const goDetail = () => {
  router.push({path:'detail'})
}

const onChange = (index) => {
  // console.log(index)
  swiperIndex.value = index;
}

const pre = (index) => {
  swiperTop.value.prev()

  // swiperItem.value.prev();
}

const next = (index) => {
  swiperTop.value.next()

  // swiperItem.value.next();
}

const goThis = (index) => {
  // console.log(swiperTop)
  swiperTop.value.swipeTo(index);
  // swiperItem.value.swipeTo(index);
}

const goParic = () => {
  router.push({path:'particulars'})
}
</script>
<style scoped lang="scss">
@import '@/assets/style/mixin';
.page {
  background: #0f1830;
  padding-top: 170px;
  padding-bottom: 200px;
  color:#fff;
}
.main-info {
  width: 100%;
  padding:0 58px;
  background: #0a0f18;
  .imgBox {
    width: 100%;
    height: 722px;
    border-radius: 24px;
    margin-bottom: 50px;
  }
}
.nameBox {
  display: flex;
  justify-content: space-between;
  height: 90px;
  .name {
    font-size: 46px;
  }
  .control {
    display: flex;
    justify-content: space-between;
    height: 90px;
    > div {
      margin-left: 40px;
      font-size: 40px;
      img {
        height: 40px;
        width: auto;
        margin-right:10px;
        vertical-align: text-bottom;
      }
    }
  }
}
.tags {
  overflow: hidden;
  margin-bottom: 20px;
  .tag {
    float: left;
    font-size:32px;
    background: #f4eacf;
    color:#040810;
    font-weight: bold;
    padding: 13px 16px 10px 16px;
   border-radius: 10px;
    margin-right: 20px;
  }
}
.info {
  font-size: 36px;
  line-height: 2;
  margin-bottom: 20px;
}

.controlBox {
  border:3PX solid #f4eacf;
  border-radius: 20px;
  padding: 42px 0;
  display: flex;
  margin-bottom: 40px;
  .cont {
    flex: 1;
    height: 30px;
    font-size: 36px;
    color:#f4eacf;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      margin-right: 16px;
      height: 50px;
    }
    &.border {
      border-right: 3PX solid #f4eacf;
    }
  }
}
.itemSwiper {
  padding: 0  50px;
  .s-title {
    display: flex;
    justify-content: space-between;
    font-size: 38px;
    margin-bottom: 80px;
  }
  .swiperBox {
    display: flex;
    margin-right: -30px;
    margin-left: -30px;
    margin-bottom: 46px;
    .leftBr {
      flex:1;
      height: 873px;
      @include center();
      img {
        width: 76px;
        height: 76px;
      }
    }
    .rightBr {
      flex:1;
      height: 873px;
      @include center();
      img {
        width: 76px;
        height: 76px;
      }
    }
    .inner {
      width: 680px;
      height: 873px;
      flex:none;
      background: pink;
    }
  }
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
  height: 873px;
}
.items-info {

  .info-title {
    font-size: 40px;
    margin-bottom: 30px;
    img {
      width: 42px;
    }
    .name {
      font-size: 46px;
      margin-right: 42px;
    }
    @include center();
  }
  .f-title {
    font-size: 40px;
    margin-bottom: 60px;
    @include center();
  }
  .btns {
    margin-bottom: 60px;
    @include center();

    .btn {
      font-size: 40px;
      padding: 25px;
      border:3px solid #fff;
      width: 320px;
      border-radius: 15px;
      @include center()
    }
  }
}
.van-swipe-item {
  display: flex;
  @include center();
}
.imgBoxInner {
   width: 80%;
  height: 80%;
  background: pink;
  border-radius: 14px;
  &.big {
    width: 94%;
    height: 94%;
  }
}
.courseBlock {
  padding: 42px 58px;
  .head {
      font-size: 46px;
      margin-bottom: 60px;
  }
}
.items {

}
.item {
  border:1px solid #484a4a;
  border-radius: 34px;
  padding: 40px;
  margin-bottom: 40px;
  display: flex;
  .imgbox {
    width: 146px;
    height: 146px;
    border-radius:15px;
    background: pink;
    flex: none;
  }
  .infoBox {
    margin-left: 40px;

     .info-title {
       font-size: 46px;
       margin-bottom: 15px;
     }
    .info-minTitle {
      font-size: 32px;
      line-height: 1.3;
      @include ellipsis2(2)
    }
  }
}

</style>
